package com.prabhat.webapp.validate;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import javax.validation.Constraint;
import javax.validation.Payload;

import com.prabhat.webapp.validate.IsUniqueUserImpl;

@Target({ ElementType.TYPE, ElementType.ANNOTATION_TYPE, ElementType.FIELD })
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = IsUniqueUserImpl.class)
@Documented
public @interface IsUniqueUser {
	String message() default "{password.type}";

	Class<?>[] groups() default {};

	Class<? extends Payload>[] payload() default {};

	/**
	 * ex: mobileNumber, emailId of user table; check User.java (of user service)
	 * @return
	 */
	String uniqueAttributeName();

}
